package test.viewmodel;

import model.Vocabulary;

import org.zkoss.bind.annotation.BindingParam;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.util.Clients;

public class VocabDataVM {
	
	private VocabDataModel vocabData;
	
	public VocabDataVM(){
		vocabData = new VocabDataModel();
	}

	public VocabDataModel getVocabData() {
		return vocabData;
	}
	
	@Command
	public void selectVocab(@BindingParam("vocab") Vocabulary selectVocab){
		Clients.showNotification("Select "+selectVocab.getName(), "info", null,"middle_center",1000);
	}
	
	@Command
	@NotifyChange("vocabData")
	public void delVocab(@BindingParam("vocab") Vocabulary selectVocab){
		vocabData.removeVocab(selectVocab);
	}
	
}
